
    //制保留2位小数，如：2，会在2后面补上00.即2.00
    function toDecimal2(x) {
      var f = parseFloat(x);
      if (isNaN(f)) {
        return false;
      }
      var f = Math.round(x*100)/100;
      var s = f.toString();
      var rs = s.indexOf('.');
      if (rs < 0) {
        rs = s.length;
        s += '.';
      }
      while (s.length <= rs + 2) {
        s += '0';
      }
      return s;
    }

var sjArr = ["金牛","成华","锦江","新都","彭州","崇州","金堂","青白江","蒲江","龙泉驿"] //成都可以购买申报的区域

function boolTaxcode(taxcode){
    if((/^[A-Z0-9]{15}$|^[A-Z0-9]{16}$|^[A-Z0-9]{17}$|^[A-Z0-9]{18}$|^[A-Z0-9]{20}$/).test(taxcode)){
      return true;
    }else{
      return false;
    }
}

//是否匹配
function boolValue(value){
	if(value == "" || value == null || value == "undefined" || typeof(value) == "undefined"){
			return false;
	}else{
			return true;
	}
}

//不能为null
function ganv(value){
	if(value == "" || value == null || value == "undefined" || typeof(value) == "undefined"){
			value="";
	}
	return value.toString().trim();
}



//匹配银行账号
function matchBank(bankNumber){
	var reg=/^\d{8,25}$/;
	if(reg.test(bankNumber)){
			return true;
	}else{
			return false;
	}
}

//匹配联系方式
function matchPhone(phoneNumber){
	var itg1 = /^(0|86|17951)?(13[0-9]|15[012356789]|17[01678]|18[0-9]|14[57])[0-9]{8}$/;
  var itg2=/^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/;
	if(itg1.test(phoneNumber)||itg2.test(phoneNumber)){
			return true;
	}else{
			return false;
	}
}

//加载界面
var uiId;
function loadHt(){
  api.require('UILoading').flower({
  center: {
      x: api.winWidth/2.0,
      y: api.winHeight/2.0
  },
  size: 30,
  mask: "rgba(0,0,0,0.5)",
  fixed: true
  }, function(ret) {
      uiId = ret.id;
  });
}

//去除
function rmHt(){
  api.require('UILoading').closeFlower({
    id: uiId
  });
}
